/*                                  ATELIER                                   */

/* %%LICENSE_TAG%%                                                            */
package edu.gmu.view.canvas;

import java.util.List;

/**
 * The LayerModelEvent object represents change to a LayerModel.
 */
public class LayerModelEvent extends java.util.EventObject
{   
    /**
     * Layers Changed Event
     */
    public static final int LAYERS_CHANGED = 0;
    
    /**
     * Order Changed Event
     */
    public static final int ORDER_CHANGED = 1;
    
    /**
     * Selected Layer Changed Event
     */
    public static final int SELECTED_CHANGED = 2;
    
    /**
     * The Data events Time stamp.  The time stamp is in
     * UTC format that indicates when the input event was
     * created.
     *
     * @see #getWhen()
     */
    protected long when;
    
    /**
     * The Ownship Contact with updated information.
     */
    protected int type = -1;
    
    /**
     * List of ScanLayers from the Model.
     */
     protected List<Layer> scanLayers = null;
    
    /**
     * Constructs a LayerModelEvent object with the specified parameters.
     * 
     * 
     * @param source
     * @param when
     * @param type
     * @param scanLayers
     */
    public LayerModelEvent( Object source, long when, int type, List<Layer> scanLayers )
    {
        super(source);
        this.when = when;
        this.type = type;
        this.scanLayers = scanLayers;
    }


    /**
     * Returns the timestamp of when this event occurred.
     *
     * @return long
     */
    public long getWhen()
    {
        return this.when;
    }
    
    /**
     * Gets the type.
     *
     * @return
     */
    public int getType( )
    {
        return this.type;
    }
    
    /**
     * Gets the scanLayers.
     * 
     * 
     * @return
     */
    public List<Layer> getScanLayers( )
    {
        return this.scanLayers;
    }

    /**
     * Returns a String object representing this Event's values.
     *
     * @return  String object representing this object.
     */
    public String toString()
    {
        return new String(super.toString() +
                          "\n    when: " + this.getWhen() +
                          "     type: " + this.type
                          );
    }

}

/*                                  ATELIER                                   */